import Vue from 'vue'
import App from './App'
import './plugins/index'
import store from './store'
import router from './router'
import 'bootstrap/dist/css/bootstrap.min.css'
import 'animate.css'
import 'normalize.css/normalize.css' // 初始化样式
import '@/assets/styles/index.scss' // 全局样式
import vFilter from '@/utils/vFilters' // 全局过滤方法
import * as echarts from 'echarts'
import '@/permission' // 验证控制
import 'xgplayer/dist/index.min.css'
import ldh from 'lodash'
import axios from 'axios'

import VForm from 'vform-builds' // 引入VFrom库
import 'vform-builds/dist/VFormDesigner.css' // 引入VForm样式
Vue.prototype.$echarts = echarts
Vue.prototype.$ldh = ldh
Vue.prototype.$axios = axios
Vue.use(VForm) // 全局注册VForm(同时注册了v-form-designe、v-form-render等组件)
// 注册全局过滤器
Object.keys(vFilter).forEach((key) => {
  Vue.filter(key, vFilter[key])
})

const environmentObj = {
  development: 'development（开发环境）',
  production: 'production（线上生产环境）',
  test: 'test（测试环境）'
}
for (const keys in environmentObj) {
  if (process.env.NODE_ENV && process.env.NODE_ENV === keys) {
    console.log(`当前环境 => ${environmentObj[keys]}`)
  }
}

Vue.config.productionTip = false
new Vue({
  el: '#app',
  router,
  store,
  render: (h) => h(App)
})
